<template>
  <div class="xtx-bread-item">
    <!-- 需要跳转的面包屑 -->
    <RouterLink v-if="path" :to="path">
      <slot></slot>
    </RouterLink>
    <!-- 不需要跳转的面包屑 -->
    <span v-else>
      <slot></slot>
    </span>
  </div>
</template>

<script>
export default {
  name: "XtxBreadItem",
  props: ["path"],
};
</script>

<style lang="less" scoped>
.xtx-bread-item {
  a {
    color: #666;
    transition: all 0.4s;

    &:hover {
      color: @xtxColor;
    }
  }

  span {
    cursor: default;
  }
}
</style>
